$(function () {

    //注册组件
    //副页面，商品列表
    Vue.component('goods-list', {
        template: '#goods',
        data() {
            return {
                activeName: 'first',
                good: [{
                    pic: '../img/1.jpeg',
                    name: '美女',
                    money: 1212,
                    shazi: 12321
                }, {
                    pic: '../img/1.jpeg',
                    name: '帅哥',
                    money: 1212,
                    shazi: 12321
                }, {
                    pic: '../img/1.jpeg',
                    name: '帅哥',
                    money: 1212,
                    shazi: 12321
                }, {
                    pic: '../img/1.jpeg',
                    name: '帅哥',
                    money: 1212,
                    shazi: 12321
                }, {
                    pic: '../img/1.jpeg',
                    name: '小刘',
                    money: 1212,
                    shazi: 12321
                }, {
                    pic: '../img/1.jpeg',
                    name: '变态',
                    money: 1212,
                    shazi: 12321
                }, {
                    pic: '../img/1.jpeg',
                    name: '婴儿车',
                    money: 1212,
                    shazi: 12321
                }, {
                    pic: '../img/1.jpeg',
                    name: '婴儿车',
                    money: 1212,
                    shazi: 12321
                }, {
                    pic: '../img/1.jpeg',
                    name: '婴儿车',
                    money: 1212,
                    shazi: 12321
                }, {
                    pic: '../img/1.jpeg',
                    name: '溜溜球',
                    money: 1212,
                    shazi: 12321
                }],
                prevlook: [{
                    pic: '../img/3.jpeg',
                    name: '小刘性感手办2020年限定款只要98e，30天必定发货',
                    zan: 123
                }, {
                    pic: '../img/3.jpeg',
                    name: '好帅哦',
                    zan: 123
                }, {
                    pic: '../img/3.jpeg',
                    name: '好帅哦',
                    zan: 123
                }, {
                    pic: '../img/3.jpeg',
                    name: '好帅哦',
                    zan: 123
                }, {
                    pic: '../img/3.jpeg',
                    name: '好帅哦',
                    zan: 123
                }, {
                    pic: '../img/3.jpeg',
                    name: '好帅哦',
                    zan: 123
                }, ],
            }
        },
        methods: {
            handleClick(tab, eve) {
                // console.log(tab,eve);
            }
        }
    })
    //主页面
    Vue.component('vip-shop', {
        template: "#vvvip",
        data() {
            return {
                topbar: [{
                    icon: 'icon-shoucang'
                }, {
                    icon: 'icon-gouwuche1'
                }, {
                    icon: 'icon-dingbudaohang-zhangh'
                }],
                bottombar: [
                    {
                        name:"首页",
                        icon:"el-icon-s-home"
                        
                    },
                    {
                        name:"频道",
                        icon:"el-icon-magic-stick"
                    },
                    {
                        name:"动态",
                        icon:"el-icon-chat-round"
                    },
                    {
                        name:"会员购",
                        icon:"el-icon-shopping-cart-2"
                    },
                    {
                        name:"我的",
                        icon:"el-icon-user-solid"
                    }
                ],
                classify: [{
                    icon: '../img/1.jpeg',
                    txt: '手办'
                }, {
                    icon: '../img/3.jpeg',
                    txt: '潮玩扭蛋'
                }, {
                    icon: '../img/2.jpg',
                    txt: '图书漫画'
                }, {
                    icon: '../img/4.jpg',
                    txt: '全部分类'
                }],
                ads: [{
                    src: '../img/ad1.jpeg'
                }, {
                    src: '../img/ad2.jpg'
                }, {
                    src: '../img/ad3.jpg'
                }, {
                    src: '../img/ad4.jpg'
                }, ]
            }
        }
    })
    var vn = new Vue({
        el: '#vipshop',
        data() {
            return {

            }
        },
    })

    //子页面滚动到指定位置导航栏固定顶部
    //  var b=document.getElementsByClassName('inside-nav')[0];
    //  console.log(b);
    var dis = $('.el-tabs__nav-scroll').offset().top;
    $(document).scroll(function () {
        dis = $('.el-tabs__nav-scroll').offset().top;
        totop = $(this).scrollTop();
        console.log(dis, totop);
        if (totop <= 60) {
            $('.el-tabs__nav-scroll').removeClass('fixVipDiv');
        } else if (dis - totop <= 60) {
            $('.el-tabs__nav-scroll').addClass('fixVipDiv');
        }
    })
})